/**
 *
 * @param base64
 * @returns base64转file
 */
export const base64png = (base64: string) =>
{
    let arr = base64.split(",") as any[];
    let mime = arr[0].match(/:(.*?);/)[1];
    let suffix = mime.split("/")[1];
    let bstr = atob(arr[1]);
    let n = bstr.length;
    let u8arr = new Uint8Array(n);

    while (n--)
    {
        u8arr[n] = bstr.charCodeAt(n);
    }
    let file_base = new File([u8arr], `${"filename"}.${suffix}`, {
        type: mime,
    });
    return file_base;
}